1. Field of the Invention
The present invention relates to an image processing method and a device thereof, and more particularly, to a method of locally improving the contrast of the image by regions and a device thereof.
2. Description of Related Art
In the field of the image processing, most people are interested in the image enhancement technique. Basically, the concept of the image enhancement technique is to make the indistinct details of the image reveal or make some interesting features of the image more obvious. The subjective sensation of human visual system is considered in the image enhancement technique. Generally speaking, the ability of human eyes for distinguishing different luminance levels affects the display result of the image processing. For example, if an image tends to dimness (or dark), the details of the image can not be clearly seen by human eyes so that the gray-level range of the image needs to be expanded, that is, performing a contrast processing on the image.
The contrast processing is to increase the dynamical gray-level range of the image. FIG. 1 is a diagram of typical transfer used for performing the contrast processing. Referring FIG. 1, the input gray-level values r1 and r2 are respectively transferred to the gray-level value s1 and s2, wherein the gray-level value r1 and r2 are respectively the minimum and maximum gray-level values of the original image. Therefore, the gray-level range of the original image can be expanded to the gray-level range between the gray-level value 0 and the gray-level value L-1 through the contrast processing.
In addition, a gray-level histogram of the image is also used for performing the contrast processing. The gray-level histogram is a discrete function expressed as h(rk)=nk, wherein rk is the kth gray-level value and nk is the pixel number of the gray-level value rk. FIGS. 2A to 2C are the respective histograms of the dim image, the bright image and the image with low contrast. Referring to FIG. 2A, if the image tends to dimness, the components of the histogram thereof are concentrated on the low gray-level values. On the contrary, referring to FIG. 2B, the components of the histogram of the bright image are concentrated on the high gray-level values. Moreover, referring to FIG. 2C, the components of the histogram of the image with low contrast are concentrated on the middle gray-level range and the said gray-level range is narrow. In intuition, the components of the histogram of the image with high contrast may contain a wide gray-level range and the pixel number is close to be uniformly distributed over each of the gray-level values. Hence, a transfer function, such as the transfer curve in FIG. 1, is developed according to the information of the histogram of the image for a purpose of making more gray-level details of the image obvious and expanding the gray-level range of the image.
However, an image may have several features or details distributing over different regions of the image and the features or details extremely differ from each other. If the contrast processing is performed on the whole image according to a fixed transfer function or a fixed contrast adjustment, the features or details are not obvious because of the mutual influences. Therefore, simultaneously giving consideration to enhance the contrast of the image and to maintain the features or details of the image is an important issue for study and discussion.